import java.util.Scanner;

public class Test09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String string = sc.next();
        char c =sc.next().charAt(0);
        int index = string.indexOf(c);
        System.out.println(index);
    }
}
